
<?php 
require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/controle/verificaCredenciais.php');
	//include '/Prototipo/controle/verificaCredenciais.php';
?>
<!DOCTYPE html>
<html lang="pt-br"  >

<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
  	<meta name="viewport" content="width=device-width" />
  	<title>Área do Administrador</title>
  	
  	<!-- estilo css -->
  	<link rel="stylesheet" href="../css/lightbox/css/lightbox.css"  />  	
  	<link rel="stylesheet/less" type="text/css" href="../js/bootstrap/twitter-bootstrap/less/bootstrap.less">
    <link rel="stylesheet/less" type="text/css" href="../js/bootstrap/twitter-bootstrap/less/responsive.less">
	
	<!-- bibliotecas javascript -->
    <script src="../css/lightbox/js/jquery-1.10.2.min.js"></script>
	<script src="../css/lightbox/js/lightbox-2.6.min.js"></script>
	<script src="../js/bootstrap.js"></script>
	<script src="../js/ckeditor/ckeditor.js"></script>
</head>

<body>
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/controle/verificaSessao.php');
?>
<div class="container center span12">
	<div class="hero-unit btn-inverse disabled">
		<h1 align="center">Área do Administrador</h1>
	</div>
	
<div class="row">
	<div class="span3">
		
		<ul class="nav nav-tabs nav-stacked nav-list">
			<li class="nav-header">Menu</li>
			<li><a href="index.php?pg=1">Cadastrar notícia</a></li>
			<li><a href="index.php?pg=2">Listar Notícias</a></li>
			<li><a href="index.php?pg=4">Moderar Comentários</a></li>
			<li><a href="index.php?pg=10">Listar Denúncias</a></li>
			<li><a href="index.php?pg=5">Cadastrar Desaparecido</a></li>
			<li><a href="index.php?pg=12">Visualizar Desaparecidos</a></li>
			<li><a href="index.php?pg=13">Visualizar Procurados</a></li>
			<li><a href="index.php?pg=6">Cadastrar Procurado da Justiça</a></li>
			<li><a href="index.php?pg=8">Listar Informativo Desaparecidos</a></li>		
			<li><a href="index.php?pg=9">Listar Informativo Procurados</a></li>
			<li><a href="index.php?pg=11">Cadastrar Usuário</a></li>			
			<li><a href="index.php?pg=7">Sair</a></li>
			<li><a href="">Outra Funcionalidade</a></li>
		</ul>		
	</div>
	
<div class="span9" id='opcoes'>
	<?php 
		if(isset($_GET['pg'])){
					$op = $_GET['pg'];
					
					switch($op){
						case 1:
							include "FormCadastrarNoticia.php";
						break;
						case 2:
							include "ListaNoticias.php";
							break;
						
						case 4:
							include 'ListaComentarios.php';
							break;
						
						case 5:
							//include "desaparecidos/formDesaparecidos.php";
							require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/visao/desaparecidos/formDesaparecidos.php');
							break;
						
						case 6:
							require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/visao/procurados/formProcurados.php');
							//include '/procurados/formProcurados.php';
							break;
						
						case 7:
							session_destroy();
							header("Location: /Prototipo/visao/index.php");
							break;
								
						case 8:
							include "ListaInformativosDesaparecidos.php";
							break;
						
						case 9:
							include "ListaInformativosProcurados.php";
							break;
						
						case 10:
							include "ListaDenuncias.php";
							break;
						
						case 11:
							include "CadastroUsuario.php";
							break;
						
						case 12:
							include "ListarDesaparecidos.php";
							break;
						
						case 13:
							include "ListarProcurados.php";
						break;

						case 'noticia':
							include "Noticia.php";
						break;

						case "editar":
							include "FormEditarNoticia.php";
						break;

						case "EditarDes":
							include "EditarDes.php";
						break;

						case "excluir-des":
							include "ExcluirDes.php";
						break;

						case "excluir-proc":
							include "ExcluirProc.php";
						break;

						case "admin":
							include "admin/areaAdmin.php";
						break;

						case "detalhes-des":
							include "DetalhesDes.php";
						break;

						case 'noticias':
							require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/visao/noticias/VerNoticia.php');
							//include 'visao/noticias/VerNoticia.php';
						break;

						case "detalhes-proc":
							include "DetalhesProc.php";
						break;

						case "detalhes-den":
							if(isset($_GET['id'])){
								$id = $_GET['id'];
								header("Location: /Prototipo/visao/admin/DetalhesDen.php?id=$id");
								//include "DetalhesDen.php";
							}
							else{
								header("Location: /Prototipo/visao/admin/");
								}	
						break;

						case "detalhes_informativo_des":
							require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/visao/informativos/desaparecidos/detalhes_inform_des.php');
						break;

						case "detalhes_informativo_proc":
							require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/visao/informativos/procurados/detalhes_inform_proc.php');
						break;

						case "buscar-noticia":
							include 'BuscaNoticia.php';
						break;

						default:
							include "home.php";
						break;
						
					}
				}
				else{
					include "home.php";
				}
			?>
		</div>
		
	</div>
</div>
</body>

<script src="../js/bootstrap/javascript/less-1.3.0.min.js"></script>
	<script src="../js/bootstrap/javascript/jquery-1.7.2.min.js"></script>
	<script src="../js/bootstrap/twitter-bootstrap/js/bootstrap-tooltip.js"></script>
	<script src="../js/bootstrap/twitter-bootstrap/js/bootstrap-popover.js"></script>
	<script src="../js/bootstrap/twitter-bootstrap/js/bootstrap-modal.js"></script>
	

	<script type="text/javascript">
		function editar(id){
			// Oculta o popover ao clicar no botão abrir modal.
		    
		    a_popover_id = '#a-popover_'+id;
			div_modal = '#div-modal_'+id;
			

			$(a_popover_id).popover('hide');
			 
			// Abre o modal.
		    $(div_modal).modal();
		    //alert(id);
			
			}
    	function mostrarDados(){
			document.write(getElementById('modal_nome_desaparecido'));

        	}
  	
		function fechar(id){
			btn_id = '#btn-fechar_'+id;
			a_popover_id = '#a-popover'+id;
	
			
	            // Oculta o popover ao clicar no botão fechar.             
	            $(a_popover).popover('hide');

			}
	
		function abre(id){
	
			a_popover = '#a-popover_'+id;
			div_popover = '#popover_'+id;
		       $(a_popover).popover({
					placement: 'top',
					trigger:'click',
					title: 'Alerta de Exclusão',
					html: true,
					content: $(div_popover).html()
			       }).popover('show');
					     
				}

		function testarChamada(){
			aler("Entrou aqui");
		
			}
		</script>
</html>